#
# Meridian Gravitas
#
# Must be compiled in Medium Memory Model
#

OPT =		e:\ak\opt

.SUFFIXES:	.obj .asm .c

.c.obj:
		cl -nologo -c -AM -I$(OPT) -Zi -Od -W3 $*.c

.asm.obj:
		masm -T $*;

all:		meridian.exe egamg.exe cgamg.exe\
		mgc.exe ec.exe\
		music.ce effects.ce chars.cf maze.cm\
		chars.ef sprites.es sprites.cs
		@echo Made Meridian Gravitas

meridian.exe:	meridian.obj
		link /NOE /NOD /NOLOGO meridian,,,mlibcer;

meridian.obj:	meridian.c

#

egamg.exe:	egamg.obj hs.obj egag.obj rawkey.obj se.obj mus.obj tick.obj
		link /NOE /NOD /NOLOGO egamg hs egag rawkey se mus tick,,, mlibcer;

cgamg.exe:	cgamg.obj hs.obj cgag.obj rawkey.obj se.obj mus.obj tick.obj
		link /NOE /NOD /NOLOGO cgamg hs cgag rawkey se mus tick,,, mlibcer;

egamg.obj:	mg.c hs.h g.h egag2.h sprites.h effects.h music.h $(OPT)\opt.h
		cl -nologo -c -AM -I$(COMMON) -DEGA -Foegamg -Od mg.c

cgamg.obj:	mg.c hs.h g.h cgag2.h sprites.h effects.h music.h $(OPT)\opt.h
		cl -nologo -c -AM -I$(COMMON) -DCGA -Focgamg -Od mg.c

mus.obj:	mus.asm

se.obj:		se.asm

rawkey.obj:	rawkey.asm

tick.obj:	tick.asm

egag.obj:	egag.asm

cgag.obj:	cgag.asm

hs.obj:		hs.c

#

music.ce:	music
		ec -h -m -q 1 music < music

effects.ce:	effects
		ec -h -q 4 effects < effects

maze.cm:	maze
		mgc maze < maze

chars.ef:	chars
		mf -e -t 175 chars < chars

chars.cf:	chars
		mf -c -t 175 chars < chars

sprites.es:	sprites
		ms -eh sprites < sprites

sprites.cs:	sprites
		ms -ch sprites < sprites

#

mgc.exe:	mgc.obj
		link /NOE /NOD /NOLOGO /CO mgc setargv,,,mlibcer;

mgc.obj:	mgc.c

#

ec.exe:		ec.obj $(OPT)\moptr.lib
		link /NOE /NOD /NOLOGO /CO ec setargv,,,$(OPT)\moptr mlibcer;

ec.obj:		ec.c $(OPT)\opt.h

#

package:	
		zip -q mg.zip \
			meridian.exe egamg.exe cgamg.exe \
			music.ce effects.ce \
			maze.cm \
			chars.ef chars.cf \
			sprites.es sprites.cs
